//
//  DBTableViewCell.m
//  The_news
//
//  Created by dlios on 15/7/19.
//  Copyright (c) 2015年 chenlin. All rights reserved.
//

#import "DBTableViewCell.h"
#import "Header.h"
#import "UIImageView+WebCache.h"
@implementation DBTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)dealloc
{
    [self.ima release];
    [self. title release];
    [self.type release];
    [self.model release];
    [super dealloc];
    
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self buildMyCell];
    }
    return  self;
}



- (void)buildMyCell
{

    self.ima = [[UIImageView alloc] initWithFrame:CGRectZero];
    [self.contentView addSubview:self.ima];
    
    self.title = [[UILabel alloc] initWithFrame:CGRectZero];
    [self.title setFont:[UIFont systemFontOfSize:12]];
    [self.contentView addSubview:self.title];
    
    self.type = [[UIImageView alloc] initWithFrame:CGRectZero];
    [self.contentView addSubview:self.type];
    
  
}

- (void)layoutSubviews
{
    self.ima.frame = CGRectMake(10, 10, self.contentView.frame.size.height - 20, self.contentView.frame.size.height - 20);
    self.ima.backgroundColor = [UIColor redColor];
    
    self.title.frame = CGRectMake(self.contentView.frame.size.height, 0, self.contentView.frame.size.width - self.contentView.frame.size.height, self.contentView.frame.size.height / 2);
    self.title.backgroundColor = [UIColor yellowColor];

    self.type.frame = CGRectMake(0, 0, self.contentView.frame.size.height / 6, self.contentView.frame.size.height / 6) ;
    [self.type setCenter:CGPointMake(self.title.center.x + 60, self.title.center.y +self.contentView.frame.size.height / 2)];
    
}

@end
